package com.xsdl.iterator;

import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {

        List<User> userList = IntStream.rangeClosed(1, 3).mapToObj(i -> {
            User user = new User();
            user.setUuid(i + "");
            user.setAge(i);
            user.setName("name" + i);
            return user;
        }).collect(Collectors.toList());


        User temp = userList.get(0);
        for (String s : temp) {
            System.out.println(s);
        }

        for (int i = 0; i < userList.size(); i++) {
            userList.add(new User());
            System.out.println(userList.get(i));
        }

    }

}
